home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / Bonus / VCLZip / kp222_b5.exe / VCLUnZip.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-23  |  35.0 KB  |  825 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'VCLUnZip.pas' rev: 5.00
  6.  
  7. #ifndef VCLUnZipHPP
  8. #define VCLUnZipHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <kpZcnst.hpp>    // Pascal unit
  14. #include <kpZipObj.hpp>    // Pascal unit
  15. #include <KpLib.hpp>    // Pascal unit
  16. #include <kpMatch.hpp>    // Pascal unit
  17. #include <kpCntn.hpp>    // Pascal unit
  18. #include <FileCtrl.hpp>    // Pascal unit
  19. #include <Dialogs.hpp>    // Pascal unit
  20. #include <Forms.hpp>    // Pascal unit
  21. #include <Controls.hpp>    // Pascal unit
  22. #include <Classes.hpp>    // Pascal unit
  23. #include <SysUtils.hpp>    // Pascal unit
  24. #include <Windows.hpp>    // Pascal unit
  25. #include <SysInit.hpp>    // Pascal unit
  26. #include <System.hpp>    // Pascal unit
  27.  
  28. //-- user supplied -----------------------------------------------------------
  29.  
  30. namespace Vclunzip
  31. {
  32. //-- type declarations -------------------------------------------------------
  33. #pragma option push -b-
  34. enum TMultiMode { mmNone, mmSpan, mmBlocks };
  35. #pragma option pop
  36.  
  37. #pragma option push -b-
  38. enum TIncompleteZipMode { izAssumeMulti, izAssumeBad, izAssumeNotAZip };
  39. #pragma option pop
  40.  
  41. #pragma option push -b-
  42. enum TUZOverwriteMode { Prompt, Always, Never, ifNewer, ifOlder };
  43. #pragma option pop
  44.  
  45. #pragma option push -b-
  46. enum TSkipReason { srBadPassword, srNoOverwrite, srFileOpenError, srCreateError };
  47. #pragma option pop
  48.  
  49. typedef int DecryptKey[3];
  50.  
  51. typedef Byte DecryptHeaderType[12];
  52.  
  53. typedef Byte *DecryptHeaderPtr;
  54.  
  55. class DELPHICLASS EBadZipFile;
  56. class PASCALIMPLEMENTATION EBadZipFile : public Sysutils::Exception 
  57. {
  58.     typedef Sysutils::Exception inherited;
  59.     
  60. public:
  61.     #pragma option push -w-inl
  62.     /* Exception.Create */ inline __fastcall EBadZipFile(const AnsiString Msg) : Sysutils::Exception(Msg
  63.         ) { }
  64.     #pragma option pop
  65.     #pragma option push -w-inl
  66.     /* Exception.CreateFmt */ inline __fastcall EBadZipFile(const AnsiString Msg, const System::TVarRec 
  67.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  68.     #pragma option pop
  69.     #pragma option push -w-inl
  70.     /* Exception.CreateRes */ inline __fastcall EBadZipFile(int Ident)/* overload */ : Sysutils::Exception(
  71.         Ident) { }
  72.     #pragma option pop
  73.     #pragma option push -w-inl
  74.     /* Exception.CreateResFmt */ inline __fastcall EBadZipFile(int Ident, const System::TVarRec * Args, 
  75.         const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  76.     #pragma option pop
  77.     #pragma option push -w-inl
  78.     /* Exception.CreateHelp */ inline __fastcall EBadZipFile(const AnsiString Msg, int AHelpContext) : 
  79.         Sysutils::Exception(Msg, AHelpContext) { }
  80.     #pragma option pop
  81.     #pragma option push -w-inl
  82.     /* Exception.CreateFmtHelp */ inline __fastcall EBadZipFile(const AnsiString Msg, const System::TVarRec 
  83.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  84.         ) { }
  85.     #pragma option pop
  86.     #pragma option push -w-inl
  87.     /* Exception.CreateResHelp */ inline __fastcall EBadZipFile(int Ident, int AHelpContext)/* overload */
  88.          : Sysutils::Exception(Ident, AHelpContext) { }
  89.     #pragma option pop
  90.     #pragma option push -w-inl
  91.     /* Exception.CreateResFmtHelp */ inline __fastcall EBadZipFile(System::PResStringRec ResStringRec, 
  92.         const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  93.         ResStringRec, Args, Args_Size, AHelpContext) { }
  94.     #pragma option pop
  95.     
  96. public:
  97.     #pragma option push -w-inl
  98.     /* TObject.Destroy */ inline __fastcall virtual ~EBadZipFile(void) { }
  99.     #pragma option pop
  100.     
  101. };
  102.  
  103.  
  104. class DELPHICLASS EFileNotAllThere;
  105. class PASCALIMPLEMENTATION EFileNotAllThere : public Sysutils::Exception 
  106. {
  107.     typedef Sysutils::Exception inherited;
  108.     
  109. public:
  110.     #pragma option push -w-inl
  111.     /* Exception.Create */ inline __fastcall EFileNotAllThere(const AnsiString Msg) : Sysutils::Exception(
  112.         Msg) { }
  113.     #pragma option pop
  114.     #pragma option push -w-inl
  115.     /* Exception.CreateFmt */ inline __fastcall EFileNotAllThere(const AnsiString Msg, const System::TVarRec 
  116.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  117.     #pragma option pop
  118.     #pragma option push -w-inl
  119.     /* Exception.CreateRes */ inline __fastcall EFileNotAllThere(int Ident)/* overload */ : Sysutils::Exception(
  120.         Ident) { }
  121.     #pragma option pop
  122.     #pragma option push -w-inl
  123.     /* Exception.CreateResFmt */ inline __fastcall EFileNotAllThere(int Ident, const System::TVarRec * 
  124.         Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  125.     #pragma option pop
  126.     #pragma option push -w-inl
  127.     /* Exception.CreateHelp */ inline __fastcall EFileNotAllThere(const AnsiString Msg, int AHelpContext
  128.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  129.     #pragma option pop
  130.     #pragma option push -w-inl
  131.     /* Exception.CreateFmtHelp */ inline __fastcall EFileNotAllThere(const AnsiString Msg, const System::TVarRec 
  132.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  133.         ) { }
  134.     #pragma option pop
  135.     #pragma option push -w-inl
  136.     /* Exception.CreateResHelp */ inline __fastcall EFileNotAllThere(int Ident, int AHelpContext)/* overload */
  137.          : Sysutils::Exception(Ident, AHelpContext) { }
  138.     #pragma option pop
  139.     #pragma option push -w-inl
  140.     /* Exception.CreateResFmtHelp */ inline __fastcall EFileNotAllThere(System::PResStringRec ResStringRec
  141.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  142.         ResStringRec, Args, Args_Size, AHelpContext) { }
  143.     #pragma option pop
  144.     
  145. public:
  146.     #pragma option push -w-inl
  147.     /* TObject.Destroy */ inline __fastcall virtual ~EFileNotAllThere(void) { }
  148.     #pragma option pop
  149.     
  150. };
  151.  
  152.  
  153. class DELPHICLASS EIncompleteZip;
  154. class PASCALIMPLEMENTATION EIncompleteZip : public Sysutils::Exception 
  155. {
  156.     typedef Sysutils::Exception inherited;
  157.     
  158. public:
  159.     #pragma option push -w-inl
  160.     /* Exception.Create */ inline __fastcall EIncompleteZip(const AnsiString Msg) : Sysutils::Exception(
  161.         Msg) { }
  162.     #pragma option pop
  163.     #pragma option push -w-inl
  164.     /* Exception.CreateFmt */ inline __fastcall EIncompleteZip(const AnsiString Msg, const System::TVarRec 
  165.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  166.     #pragma option pop
  167.     #pragma option push -w-inl
  168.     /* Exception.CreateRes */ inline __fastcall EIncompleteZip(int Ident)/* overload */ : Sysutils::Exception(
  169.         Ident) { }
  170.     #pragma option pop
  171.     #pragma option push -w-inl
  172.     /* Exception.CreateResFmt */ inline __fastcall EIncompleteZip(int Ident, const System::TVarRec * Args
  173.         , const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  174.     #pragma option pop
  175.     #pragma option push -w-inl
  176.     /* Exception.CreateHelp */ inline __fastcall EIncompleteZip(const AnsiString Msg, int AHelpContext)
  177.          : Sysutils::Exception(Msg, AHelpContext) { }
  178.     #pragma option pop
  179.     #pragma option push -w-inl
  180.     /* Exception.CreateFmtHelp */ inline __fastcall EIncompleteZip(const AnsiString Msg, const System::TVarRec 
  181.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  182.         ) { }
  183.     #pragma option pop
  184.     #pragma option push -w-inl
  185.     /* Exception.CreateResHelp */ inline __fastcall EIncompleteZip(int Ident, int AHelpContext)/* overload */
  186.          : Sysutils::Exception(Ident, AHelpContext) { }
  187.     #pragma option pop
  188.     #pragma option push -w-inl
  189.     /* Exception.CreateResFmtHelp */ inline __fastcall EIncompleteZip(System::PResStringRec ResStringRec
  190.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  191.         ResStringRec, Args, Args_Size, AHelpContext) { }
  192.     #pragma option pop
  193.     
  194. public:
  195.     #pragma option push -w-inl
  196.     /* TObject.Destroy */ inline __fastcall virtual ~EIncompleteZip(void) { }
  197.     #pragma option pop
  198.     
  199. };
  200.  
  201.  
  202. class DELPHICLASS ENotAZipFile;
  203. class PASCALIMPLEMENTATION ENotAZipFile : public Sysutils::Exception 
  204. {
  205.     typedef Sysutils::Exception inherited;
  206.     
  207. public:
  208.     #pragma option push -w-inl
  209.     /* Exception.Create */ inline __fastcall ENotAZipFile(const AnsiString Msg) : Sysutils::Exception(Msg
  210.         ) { }
  211.     #pragma option pop
  212.     #pragma option push -w-inl
  213.     /* Exception.CreateFmt */ inline __fastcall ENotAZipFile(const AnsiString Msg, const System::TVarRec 
  214.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  215.     #pragma option pop
  216.     #pragma option push -w-inl
  217.     /* Exception.CreateRes */ inline __fastcall ENotAZipFile(int Ident)/* overload */ : Sysutils::Exception(
  218.         Ident) { }
  219.     #pragma option pop
  220.     #pragma option push -w-inl
  221.     /* Exception.CreateResFmt */ inline __fastcall ENotAZipFile(int Ident, const System::TVarRec * Args
  222.         , const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  223.     #pragma option pop
  224.     #pragma option push -w-inl
  225.     /* Exception.CreateHelp */ inline __fastcall ENotAZipFile(const AnsiString Msg, int AHelpContext) : 
  226.         Sysutils::Exception(Msg, AHelpContext) { }
  227.     #pragma option pop
  228.     #pragma option push -w-inl
  229.     /* Exception.CreateFmtHelp */ inline __fastcall ENotAZipFile(const AnsiString Msg, const System::TVarRec 
  230.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  231.         ) { }
  232.     #pragma option pop
  233.     #pragma option push -w-inl
  234.     /* Exception.CreateResHelp */ inline __fastcall ENotAZipFile(int Ident, int AHelpContext)/* overload */
  235.          : Sysutils::Exception(Ident, AHelpContext) { }
  236.     #pragma option pop
  237.     #pragma option push -w-inl
  238.     /* Exception.CreateResFmtHelp */ inline __fastcall ENotAZipFile(System::PResStringRec ResStringRec, 
  239.         const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  240.         ResStringRec, Args, Args_Size, AHelpContext) { }
  241.     #pragma option pop
  242.     
  243. public:
  244.     #pragma option push -w-inl
  245.     /* TObject.Destroy */ inline __fastcall virtual ~ENotAZipFile(void) { }
  246.     #pragma option pop
  247.     
  248. };
  249.  
  250.  
  251. class DELPHICLASS EFatalUnzipError;
  252. class PASCALIMPLEMENTATION EFatalUnzipError : public Sysutils::Exception 
  253. {
  254.     typedef Sysutils::Exception inherited;
  255.     
  256. public:
  257.     #pragma option push -w-inl
  258.     /* Exception.Create */ inline __fastcall EFatalUnzipError(const AnsiString Msg) : Sysutils::Exception(
  259.         Msg) { }
  260.     #pragma option pop
  261.     #pragma option push -w-inl
  262.     /* Exception.CreateFmt */ inline __fastcall EFatalUnzipError(const AnsiString Msg, const System::TVarRec 
  263.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  264.     #pragma option pop
  265.     #pragma option push -w-inl
  266.     /* Exception.CreateRes */ inline __fastcall EFatalUnzipError(int Ident)/* overload */ : Sysutils::Exception(
  267.         Ident) { }
  268.     #pragma option pop
  269.     #pragma option push -w-inl
  270.     /* Exception.CreateResFmt */ inline __fastcall EFatalUnzipError(int Ident, const System::TVarRec * 
  271.         Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  272.     #pragma option pop
  273.     #pragma option push -w-inl
  274.     /* Exception.CreateHelp */ inline __fastcall EFatalUnzipError(const AnsiString Msg, int AHelpContext
  275.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  276.     #pragma option pop
  277.     #pragma option push -w-inl
  278.     /* Exception.CreateFmtHelp */ inline __fastcall EFatalUnzipError(const AnsiString Msg, const System::TVarRec 
  279.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  280.         ) { }
  281.     #pragma option pop
  282.     #pragma option push -w-inl
  283.     /* Exception.CreateResHelp */ inline __fastcall EFatalUnzipError(int Ident, int AHelpContext)/* overload */
  284.          : Sysutils::Exception(Ident, AHelpContext) { }
  285.     #pragma option pop
  286.     #pragma option push -w-inl
  287.     /* Exception.CreateResFmtHelp */ inline __fastcall EFatalUnzipError(System::PResStringRec ResStringRec
  288.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  289.         ResStringRec, Args, Args_Size, AHelpContext) { }
  290.     #pragma option pop
  291.     
  292. public:
  293.     #pragma option push -w-inl
  294.     /* TObject.Destroy */ inline __fastcall virtual ~EFatalUnzipError(void) { }
  295.     #pragma option pop
  296.     
  297. };
  298.  
  299.  
  300. class DELPHICLASS EUserCanceled;
  301. class PASCALIMPLEMENTATION EUserCanceled : public Sysutils::Exception 
  302. {
  303.     typedef Sysutils::Exception inherited;
  304.     
  305. public:
  306.     #pragma option push -w-inl
  307.     /* Exception.Create */ inline __fastcall EUserCanceled(const AnsiString Msg) : Sysutils::Exception(
  308.         Msg) { }
  309.     #pragma option pop
  310.     #pragma option push -w-inl
  311.     /* Exception.CreateFmt */ inline __fastcall EUserCanceled(const AnsiString Msg, const System::TVarRec 
  312.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  313.     #pragma option pop
  314.     #pragma option push -w-inl
  315.     /* Exception.CreateRes */ inline __fastcall EUserCanceled(int Ident)/* overload */ : Sysutils::Exception(
  316.         Ident) { }
  317.     #pragma option pop
  318.     #pragma option push -w-inl
  319.     /* Exception.CreateResFmt */ inline __fastcall EUserCanceled(int Ident, const System::TVarRec * Args
  320.         , const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  321.     #pragma option pop
  322.     #pragma option push -w-inl
  323.     /* Exception.CreateHelp */ inline __fastcall EUserCanceled(const AnsiString Msg, int AHelpContext) : 
  324.         Sysutils::Exception(Msg, AHelpContext) { }
  325.     #pragma option pop
  326.     #pragma option push -w-inl
  327.     /* Exception.CreateFmtHelp */ inline __fastcall EUserCanceled(const AnsiString Msg, const System::TVarRec 
  328.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  329.         ) { }
  330.     #pragma option pop
  331.     #pragma option push -w-inl
  332.     /* Exception.CreateResHelp */ inline __fastcall EUserCanceled(int Ident, int AHelpContext)/* overload */
  333.          : Sysutils::Exception(Ident, AHelpContext) { }
  334.     #pragma option pop
  335.     #pragma option push -w-inl
  336.     /* Exception.CreateResFmtHelp */ inline __fastcall EUserCanceled(System::PResStringRec ResStringRec
  337.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  338.         ResStringRec, Args, Args_Size, AHelpContext) { }
  339.     #pragma option pop
  340.     
  341. public:
  342.     #pragma option push -w-inl
  343.     /* TObject.Destroy */ inline __fastcall virtual ~EUserCanceled(void) { }
  344.     #pragma option pop
  345.     
  346. };
  347.  
  348.  
  349. class DELPHICLASS EInvalidPassword;
  350. class PASCALIMPLEMENTATION EInvalidPassword : public Sysutils::Exception 
  351. {
  352.     typedef Sysutils::Exception inherited;
  353.     
  354. public:
  355.     #pragma option push -w-inl
  356.     /* Exception.Create */ inline __fastcall EInvalidPassword(const AnsiString Msg) : Sysutils::Exception(
  357.         Msg) { }
  358.     #pragma option pop
  359.     #pragma option push -w-inl
  360.     /* Exception.CreateFmt */ inline __fastcall EInvalidPassword(const AnsiString Msg, const System::TVarRec 
  361.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  362.     #pragma option pop
  363.     #pragma option push -w-inl
  364.     /* Exception.CreateRes */ inline __fastcall EInvalidPassword(int Ident)/* overload */ : Sysutils::Exception(
  365.         Ident) { }
  366.     #pragma option pop
  367.     #pragma option push -w-inl
  368.     /* Exception.CreateResFmt */ inline __fastcall EInvalidPassword(int Ident, const System::TVarRec * 
  369.         Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  370.     #pragma option pop
  371.     #pragma option push -w-inl
  372.     /* Exception.CreateHelp */ inline __fastcall EInvalidPassword(const AnsiString Msg, int AHelpContext
  373.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  374.     #pragma option pop
  375.     #pragma option push -w-inl
  376.     /* Exception.CreateFmtHelp */ inline __fastcall EInvalidPassword(const AnsiString Msg, const System::TVarRec 
  377.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  378.         ) { }
  379.     #pragma option pop
  380.     #pragma option push -w-inl
  381.     /* Exception.CreateResHelp */ inline __fastcall EInvalidPassword(int Ident, int AHelpContext)/* overload */
  382.          : Sysutils::Exception(Ident, AHelpContext) { }
  383.     #pragma option pop
  384.     #pragma option push -w-inl
  385.     /* Exception.CreateResFmtHelp */ inline __fastcall EInvalidPassword(System::PResStringRec ResStringRec
  386.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  387.         ResStringRec, Args, Args_Size, AHelpContext) { }
  388.     #pragma option pop
  389.     
  390. public:
  391.     #pragma option push -w-inl
  392.     /* TObject.Destroy */ inline __fastcall virtual ~EInvalidPassword(void) { }
  393.     #pragma option pop
  394.     
  395. };
  396.  
  397.  
  398. class DELPHICLASS EBiggerThanUncompressed;
  399. class PASCALIMPLEMENTATION EBiggerThanUncompressed : public Sysutils::Exception 
  400. {
  401.     typedef Sysutils::Exception inherited;
  402.     
  403. public:
  404.     #pragma option push -w-inl
  405.     /* Exception.Create */ inline __fastcall EBiggerThanUncompressed(const AnsiString Msg) : Sysutils::Exception(
  406.         Msg) { }
  407.     #pragma option pop
  408.     #pragma option push -w-inl
  409.     /* Exception.CreateFmt */ inline __fastcall EBiggerThanUncompressed(const AnsiString Msg, const System::TVarRec 
  410.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  411.     #pragma option pop
  412.     #pragma option push -w-inl
  413.     /* Exception.CreateRes */ inline __fastcall EBiggerThanUncompressed(int Ident)/* overload */ : Sysutils::Exception(
  414.         Ident) { }
  415.     #pragma option pop
  416.     #pragma option push -w-inl
  417.     /* Exception.CreateResFmt */ inline __fastcall EBiggerThanUncompressed(int Ident, const System::TVarRec 
  418.         * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  419.     #pragma option pop
  420.     #pragma option push -w-inl
  421.     /* Exception.CreateHelp */ inline __fastcall EBiggerThanUncompressed(const AnsiString Msg, int AHelpContext
  422.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  423.     #pragma option pop
  424.     #pragma option push -w-inl
  425.     /* Exception.CreateFmtHelp */ inline __fastcall EBiggerThanUncompressed(const AnsiString Msg, const 
  426.         System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size
  427.         , AHelpContext) { }
  428.     #pragma option pop
  429.     #pragma option push -w-inl
  430.     /* Exception.CreateResHelp */ inline __fastcall EBiggerThanUncompressed(int Ident, int AHelpContext
  431.         )/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
  432.     #pragma option pop
  433.     #pragma option push -w-inl
  434.     /* Exception.CreateResFmtHelp */ inline __fastcall EBiggerThanUncompressed(System::PResStringRec ResStringRec
  435.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  436.         ResStringRec, Args, Args_Size, AHelpContext) { }
  437.     #pragma option pop
  438.     
  439. public:
  440.     #pragma option push -w-inl
  441.     /* TObject.Destroy */ inline __fastcall virtual ~EBiggerThanUncompressed(void) { }
  442.     #pragma option pop
  443.     
  444. };
  445.  
  446.  
  447. class DELPHICLASS ENotEnoughRoom;
  448. class PASCALIMPLEMENTATION ENotEnoughRoom : public Sysutils::Exception 
  449. {
  450.     typedef Sysutils::Exception inherited;
  451.     
  452. public:
  453.     #pragma option push -w-inl
  454.     /* Exception.Create */ inline __fastcall ENotEnoughRoom(const AnsiString Msg) : Sysutils::Exception(
  455.         Msg) { }
  456.     #pragma option pop
  457.     #pragma option push -w-inl
  458.     /* Exception.CreateFmt */ inline __fastcall ENotEnoughRoom(const AnsiString Msg, const System::TVarRec 
  459.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  460.     #pragma option pop
  461.     #pragma option push -w-inl
  462.     /* Exception.CreateRes */ inline __fastcall ENotEnoughRoom(int Ident)/* overload */ : Sysutils::Exception(
  463.         Ident) { }
  464.     #pragma option pop
  465.     #pragma option push -w-inl
  466.     /* Exception.CreateResFmt */ inline __fastcall ENotEnoughRoom(int Ident, const System::TVarRec * Args
  467.         , const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  468.     #pragma option pop
  469.     #pragma option push -w-inl
  470.     /* Exception.CreateHelp */ inline __fastcall ENotEnoughRoom(const AnsiString Msg, int AHelpContext)
  471.          : Sysutils::Exception(Msg, AHelpContext) { }
  472.     #pragma option pop
  473.     #pragma option push -w-inl
  474.     /* Exception.CreateFmtHelp */ inline __fastcall ENotEnoughRoom(const AnsiString Msg, const System::TVarRec 
  475.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  476.         ) { }
  477.     #pragma option pop
  478.     #pragma option push -w-inl
  479.     /* Exception.CreateResHelp */ inline __fastcall ENotEnoughRoom(int Ident, int AHelpContext)/* overload */
  480.          : Sysutils::Exception(Ident, AHelpContext) { }
  481.     #pragma option pop
  482.     #pragma option push -w-inl
  483.     /* Exception.CreateResFmtHelp */ inline __fastcall ENotEnoughRoom(System::PResStringRec ResStringRec
  484.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  485.         ResStringRec, Args, Args_Size, AHelpContext) { }
  486.     #pragma option pop
  487.     
  488. public:
  489.     #pragma option push -w-inl
  490.     /* TObject.Destroy */ inline __fastcall virtual ~ENotEnoughRoom(void) { }
  491.     #pragma option pop
  492.     
  493. };
  494.  
  495.  
  496. class DELPHICLASS ECantWriteUCF;
  497. class PASCALIMPLEMENTATION ECantWriteUCF : public Sysutils::Exception 
  498. {
  499.     typedef Sysutils::Exception inherited;
  500.     
  501. public:
  502.     #pragma option push -w-inl
  503.     /* Exception.Create */ inline __fastcall ECantWriteUCF(const AnsiString Msg) : Sysutils::Exception(
  504.         Msg) { }
  505.     #pragma option pop
  506.     #pragma option push -w-inl
  507.     /* Exception.CreateFmt */ inline __fastcall ECantWriteUCF(const AnsiString Msg, const System::TVarRec 
  508.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  509.     #pragma option pop
  510.     #pragma option push -w-inl
  511.     /* Exception.CreateRes */ inline __fastcall ECantWriteUCF(int Ident)/* overload */ : Sysutils::Exception(
  512.         Ident) { }
  513.     #pragma option pop
  514.     #pragma option push -w-inl
  515.     /* Exception.CreateResFmt */ inline __fastcall ECantWriteUCF(int Ident, const System::TVarRec * Args
  516.         , const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  517.     #pragma option pop
  518.     #pragma option push -w-inl
  519.     /* Exception.CreateHelp */ inline __fastcall ECantWriteUCF(const AnsiString Msg, int AHelpContext) : 
  520.         Sysutils::Exception(Msg, AHelpContext) { }
  521.     #pragma option pop
  522.     #pragma option push -w-inl
  523.     /* Exception.CreateFmtHelp */ inline __fastcall ECantWriteUCF(const AnsiString Msg, const System::TVarRec 
  524.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  525.         ) { }
  526.     #pragma option pop
  527.     #pragma option push -w-inl
  528.     /* Exception.CreateResHelp */ inline __fastcall ECantWriteUCF(int Ident, int AHelpContext)/* overload */
  529.          : Sysutils::Exception(Ident, AHelpContext) { }
  530.     #pragma option pop
  531.     #pragma option push -w-inl
  532.     /* Exception.CreateResFmtHelp */ inline __fastcall ECantWriteUCF(System::PResStringRec ResStringRec
  533.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  534.         ResStringRec, Args, Args_Size, AHelpContext) { }
  535.     #pragma option pop
  536.     
  537. public:
  538.     #pragma option push -w-inl
  539.     /* TObject.Destroy */ inline __fastcall virtual ~ECantWriteUCF(void) { }
  540.     #pragma option pop
  541.     
  542. };
  543.  
  544.  
  545. typedef void __fastcall (__closure *TStartUnzipInfo)(System::TObject* Sender, int NumFiles, double TotalBytes
  546.     , bool &StopNow);
  547.  
  548. typedef void __fastcall (__closure *TStartUnZipEvent)(System::TObject* Sender, int FileIndex, AnsiString 
  549.     &FName, bool &Skip);
  550.  
  551. typedef void __fastcall (__closure *TEndUnZipEvent)(System::TObject* Sender, int FileIndex, AnsiString 
  552.     FName);
  553.  
  554. typedef void __fastcall (__closure *TFilePercentDone)(System::TObject* Sender, int Percent);
  555.  
  556. typedef void __fastcall (__closure *TTotalPercentDone)(System::TObject* Sender, int Percent);
  557.  
  558. typedef void __fastcall (__closure *TPromptForOverwrite)(System::TObject* Sender, bool &OverWriteIt, 
  559.     int FileIndex, AnsiString &FName);
  560.  
  561. typedef void __fastcall (__closure *TSkippingFile)(System::TObject* Sender, TSkipReason Reason, AnsiString 
  562.     FName, int FileIndex, bool &Retry);
  563.  
  564. typedef void __fastcall (__closure *TBadPassword)(System::TObject* Sender, int FileIndex, AnsiString 
  565.     &NewPassword);
  566.  
  567. typedef void __fastcall (__closure *TBadCRC)(System::TObject* Sender, int CalcCRC, int StoredCRC, int 
  568.     FileIndex);
  569.  
  570. typedef void __fastcall (__closure *TIncompleteZip)(System::TObject* Sender, TIncompleteZipMode &IncompleteMode
  571.     );
  572.  
  573. typedef void __fastcall (__closure *TGetNextDisk)(System::TObject* Sender, int NextDisk, AnsiString 
  574.     &FName);
  575.  
  576. typedef void __fastcall (__closure *TUnZipComplete)(System::TObject* sender, int FileCount);
  577.  
  578. typedef void __fastcall (__closure *TGetNextBuffer)(System::TObject* Sender, char * &Buffer, AnsiString 
  579.     FName, int AmountUsed, int BufferNum, bool &Quit);
  580.  
  581. class DELPHICLASS TVCLUnZip;
  582. class PASCALIMPLEMENTATION TVCLUnZip : public Classes::TComponent 
  583. {
  584.     typedef Classes::TComponent inherited;
  585.     
  586. private:
  587.     AnsiString FZipName;
  588.     AnsiString FDestDir;
  589.     Kpzipobj::TZipSortMode FSortMode;
  590.     bool FReCreateDir;
  591.     TUZOverwriteMode FOverwriteMode;
  592.     Classes::TStrings* FFilesList;
  593.     bool FDoAll;
  594.     AnsiString FPassword;
  595.     TIncompleteZipMode FIncompleteZipMode;
  596.     bool FKeepZipOpen;
  597.     bool FDoProcessMessages;
  598.     int FNumDisks;
  599.     bool FRetainAttributes;
  600.     int FThisVersion;
  601.     bool FReplaceReadOnly;
  602.     int FNumSelected;
  603.     int FBufferLength;
  604.     bool FImproperZip;
  605.     TStartUnzipInfo FOnStartUnzipInfo;
  606.     TStartUnZipEvent FOnStartUnZip;
  607.     TEndUnZipEvent FOnEndUnZip;
  608.     TPromptForOverwrite FOnPromptForOverwrite;
  609.     TBadPassword FOnBadPassword;
  610.     TBadCRC FOnBadCRC;
  611.     TIncompleteZip FOnInCompleteZip;
  612.     TUnZipComplete FOnUnzipComplete;
  613.     TGetNextBuffer FOnGetNextBuffer;
  614.     bool __fastcall ProcessIntegrityCheck(int Index);
  615.     
  616. protected:
  617.     TFilePercentDone FOnFilePercentDone;
  618.     TTotalPercentDone FOnTotalPercentDone;
  619.     TSkippingFile FOnSkippingFile;
  620.     TGetNextDisk FOnGetNextDisk;
  621.     Classes::TStream* FArchiveStream;
  622.     bool FBusy;
  623.     AnsiString FRootDir;
  624.     bool FTestMode;
  625.     bool FFlushFilesOnClose;
  626.     int FBufferedStreamSize;
  627.     bool ArchiveIsStream;
  628.     bool FCheckDiskLabels;
  629.     TMultiMode FMultiMode;
  630.     Kpzipobj::TZipHeaderInfo* file_info;
  631.     Kpzipobj::TSortedZip* files;
  632.     Kpzipobj::TSortedZip* sortfiles;
  633.     System::TDateTime filesDate;
  634.     bool ZipIsBad;
  635.     int CurrentDisk;
  636.     Classes::TStream* theZipFile;
  637.     unsigned Crc32Val;
  638.     #pragma pack(push, 1)
  639.     Kpzipobj::local_file_header lrec;
  640.     #pragma pack(pop)
  641.     
  642.     #pragma pack(push, 1)
  643.     Kpzipobj::central_file_header crec;
  644.     #pragma pack(pop)
  645.     
  646.     Kpzipobj::TEndCentral* ecrec;
  647.     int ZipCommentPos;
  648.     bool UnZippingSelected;
  649.     AnsiString tmpMStr;
  650.     int Key[3];
  651.     bool CancelOperation;
  652.     Classes::TStream* ZipStream;
  653.     bool StreamZipping;
  654.     bool MemZipping;
  655.     char *MemBuffer;
  656.     int MemLen;
  657.     int MemLeft;
  658.     char *CurrMem;
  659.     bool Fixing;
  660.     bool DR;
  661.     double TotalUncompressedSize;
  662.     double TotalBytesDone;
  663.     void __fastcall OpenZip(void);
  664.     void __fastcall CloseZip(void);
  665.     int __fastcall GetCount(void);
  666.     void __fastcall GetFileInfo(Classes::TStream* infofile);
  667.     AnsiString __fastcall GetZipName(void);
  668.     virtual void __fastcall SetZipName(AnsiString ZName);
  669.     void __fastcall SetArchiveStream(Classes::TStream* theStream);
  670.     AnsiString __fastcall GetDestDir(void);
  671.     void __fastcall SetDestDir(AnsiString DDir);
  672.     void __fastcall SetRootDir(AnsiString Value);
  673.     int __fastcall UnZipFiles(Classes::TStream* zip_in_file);
  674.     unsigned __fastcall UpdCRC(Byte Octet, unsigned Crc);
  675.     Classes::TStream* __fastcall SwapDisk(int NewDisk);
  676.     void __fastcall SetFileComment(int Index, AnsiString theComment);
  677.     void __fastcall SetZipComment(AnsiString theComment);
  678.     void __fastcall WriteNumDisks(int NumberOfDisks);
  679.     void __fastcall NewDiskEvent(System::TObject* Sender, Classes::TStream* &S);
  680.     void __fastcall SetThisVersion(int v);
  681.     virtual bool __fastcall GetCheckDiskLabels(void);
  682.     virtual void __fastcall SetCheckDiskLabels(bool Value);
  683.     virtual TMultiMode __fastcall GetMultiMode(void);
  684.     virtual void __fastcall SetMultiMode(TMultiMode Value);
  685.     void __fastcall SetFilesList(Classes::TStrings* Value);
  686.     AnsiString __fastcall GetFilename(int Index);
  687.     AnsiString __fastcall GetPathname(int Index);
  688.     AnsiString __fastcall GetFullname(int Index);
  689.     Word __fastcall GetCompressMethod(int Index);
  690.     AnsiString __fastcall GetCompressMethodStr(int Index);
  691.     System::TDateTime __fastcall GetDateTime(int Index);
  692.     unsigned __fastcall GetCrc(int Index);
  693.     int __fastcall GetCompressedSize(int Index);
  694.     int __fastcall GetUnCompressedSize(int Index);
  695.     unsigned __fastcall GetExternalFileAttributes(int Index);
  696.     bool __fastcall GetIsEncrypted(int Index);
  697.     bool __fastcall GetHasComment(int Index);
  698.     AnsiString __fastcall GetFileComment(int Index);
  699.     bool __fastcall GetFileIsOK(int Index);
  700.     int __fastcall GetDiskNo(int Index);
  701.     bool __fastcall GetSelected(int Index);
  702.     void __fastcall SetSelected(int Index, bool Value);
  703.     bool __fastcall GetZipHasComment(void);
  704.     AnsiString __fastcall GetZipComment(void);
  705.     int __fastcall GetZipSize(void);
  706.     Byte __fastcall DecryptTheHeader(AnsiString Passwrd, Classes::TStream* zfile);
  707.     void __fastcall update_keys(char ch);
  708.     Byte __fastcall decrypt_byte(void);
  709.     void __fastcall Init_Keys(AnsiString Passwrd);
  710.     void __fastcall decrypt_buff(Windows::PByte bufptr, int num_to_decrypt);
  711.     void __fastcall Update_CRC_buff(Windows::PByte bufptr, int num_to_update);
  712.     void __fastcall DefaultGetNextDisk(System::TObject* Sender, int NextDisk, AnsiString &FName);
  713.     virtual void __fastcall Loaded(void);
  714.     
  715. public:
  716.     __fastcall virtual TVCLUnZip(Classes::TComponent* AOwner);
  717.     __fastcall virtual ~TVCLUnZip(void);
  718.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  719.     void __fastcall ReadZip(void);
  720.     int __fastcall UnZip(void);
  721.     int __fastcall UnZipSelected(void);
  722.     void __fastcall ClearSelected(void);
  723.     void __fastcall ClearZip(void);
  724.     void __fastcall FillList(Classes::TStrings* FilesList);
  725.     void __fastcall Sort(Kpzipobj::TZipSortMode SMode);
  726.     void __fastcall CancelTheOperation(void);
  727.     void __fastcall AskForNewDisk(int NewDisk);
  728.     int __fastcall UnZipToStream(Classes::TStream* theStream, AnsiString FName);
  729.     int __fastcall UnZipToStreamByIndex(Classes::TStream* theStream, int Index);
  730.     int __fastcall UnZipToBuffer(char * &Buffer, AnsiString FName);
  731.     int __fastcall UnZipToBufferByIndex(char * &Buffer, int Index);
  732.     void __fastcall ResetFileIsOK(int Index);
  733.     bool __fastcall CheckArchive(void);
  734.     Byte __fastcall DecryptHeaderByte(AnsiString Passwrd, const Byte * dh);
  735.     void __fastcall GetDecryptHeaderPtr(int Index, Windows::PByte dhPtr);
  736.     Byte __fastcall DecryptHeaderByteByPtr(AnsiString Passwrd, Windows::PByte dh);
  737.     __property Classes::TStream* ArchiveStream = {read=theZipFile, write=SetArchiveStream};
  738.     __property int Count = {read=GetCount, nodefault};
  739.     __property AnsiString Filename[int Index] = {read=GetFilename};
  740.     __property AnsiString Pathname[int Index] = {read=GetPathname};
  741.     __property AnsiString FullName[int Index] = {read=GetFullname};
  742.     __property Word CompressMethod[int Index] = {read=GetCompressMethod};
  743.     __property AnsiString CompressMethodStr[int Index] = {read=GetCompressMethodStr};
  744.     __property System::TDateTime DateTime[int Index] = {read=GetDateTime};
  745.     __property unsigned Crc[int Index] = {read=GetCrc};
  746.     __property int CompressedSize[int Index] = {read=GetCompressedSize};
  747.     __property int UnCompressedSize[int Index] = {read=GetUnCompressedSize};
  748.     __property unsigned ExternalFileAttributes[int Index] = {read=GetExternalFileAttributes};
  749.     __property bool IsEncrypted[int Index] = {read=GetIsEncrypted};
  750.     __property bool FileHasComment[int Index] = {read=GetHasComment};
  751.     __property AnsiString FileComment[int Index] = {read=GetFileComment};
  752.     __property bool FileIsOK[int Index] = {read=GetFileIsOK};
  753.     __property int DiskNo[int Index] = {read=GetDiskNo};
  754.     __property bool Selected[int Index] = {read=GetSelected, write=SetSelected};
  755.     __property AnsiString ZipComment = {read=GetZipComment};
  756.     __property AnsiString Password = {read=FPassword, write=FPassword};
  757.     __property bool ZipHasComment = {read=GetZipHasComment, nodefault};
  758.     __property int NumDisks = {read=FNumDisks, nodefault};
  759.     __property int ZipSize = {read=GetZipSize, nodefault};
  760.     __property bool CheckDiskLabels = {read=GetCheckDiskLabels, write=SetCheckDiskLabels, default=1};
  761.     __property TMultiMode MultiMode = {read=GetMultiMode, write=SetMultiMode, default=0};
  762.     __property bool Busy = {read=FBusy, default=0};
  763.     __property int NumSelected = {read=FNumSelected, nodefault};
  764.     __property int BufferLength = {read=FBufferLength, write=FBufferLength, default=0};
  765.     __property bool ImproperZip = {read=FImproperZip, default=0};
  766.     __property int BufferedStreamSize = {read=FBufferedStreamSize, write=FBufferedStreamSize, default=8192
  767.         };
  768.     
  769. __published:
  770.     __property int ThisVersion = {read=FThisVersion, write=SetThisVersion, default=222};
  771.     __property AnsiString ZipName = {read=GetZipName, write=SetZipName};
  772.     __property AnsiString DestDir = {read=GetDestDir, write=SetDestDir};
  773.     __property AnsiString RootDir = {read=FRootDir, write=SetRootDir};
  774.     __property Kpzipobj::TZipSortMode SortMode = {read=FSortMode, write=FSortMode, default=7};
  775.     __property bool RecreateDirs = {read=FReCreateDir, write=FReCreateDir, default=0};
  776.     __property TUZOverwriteMode OverwriteMode = {read=FOverwriteMode, write=FOverwriteMode, default=0};
  777.         
  778.     __property Classes::TStrings* FilesList = {read=FFilesList, write=SetFilesList};
  779.     __property bool DoAll = {read=FDoAll, write=FDoAll, default=0};
  780.     __property TIncompleteZipMode IncompleteZipMode = {read=FIncompleteZipMode, write=FIncompleteZipMode
  781.         , default=0};
  782.     __property bool KeepZipOpen = {read=FKeepZipOpen, write=FKeepZipOpen, default=0};
  783.     __property bool DoProcessMessages = {read=FDoProcessMessages, write=FDoProcessMessages, default=1};
  784.         
  785.     __property bool RetainAttributes = {read=FRetainAttributes, write=FRetainAttributes, default=1};
  786.     __property bool ReplaceReadOnly = {read=FReplaceReadOnly, write=FReplaceReadOnly, default=0};
  787.     __property bool FlushFilesOnClose = {read=FFlushFilesOnClose, write=FFlushFilesOnClose, default=0};
  788.         
  789.     __property TStartUnzipInfo OnStartUnZipInfo = {read=FOnStartUnzipInfo, write=FOnStartUnzipInfo};
  790.     __property TFilePercentDone OnFilePercentDone = {read=FOnFilePercentDone, write=FOnFilePercentDone}
  791.         ;
  792.     __property TTotalPercentDone OnTotalPercentDone = {read=FOnTotalPercentDone, write=FOnTotalPercentDone
  793.         };
  794.     __property TStartUnZipEvent OnStartUnZip = {read=FOnStartUnZip, write=FOnStartUnZip};
  795.     __property TEndUnZipEvent OnEndUnZip = {read=FOnEndUnZip, write=FOnEndUnZip};
  796.     __property TPromptForOverwrite OnPromptForOverwrite = {read=FOnPromptForOverwrite, write=FOnPromptForOverwrite
  797.         };
  798.     __property TSkippingFile OnSkippingFile = {read=FOnSkippingFile, write=FOnSkippingFile};
  799.     __property TBadPassword OnBadPassword = {read=FOnBadPassword, write=FOnBadPassword};
  800.     __property TBadCRC OnBadCRC = {read=FOnBadCRC, write=FOnBadCRC};
  801.     __property TIncompleteZip OnInCompleteZip = {read=FOnInCompleteZip, write=FOnInCompleteZip};
  802.     __property TGetNextDisk OnGetNextDisk = {read=FOnGetNextDisk, write=FOnGetNextDisk};
  803.     __property TUnZipComplete OnUnZipComplete = {read=FOnUnzipComplete, write=FOnUnzipComplete};
  804.     __property TGetNextBuffer OnGetNextBuffer = {read=FOnGetNextBuffer, write=FOnGetNextBuffer};
  805. };
  806.  
  807.  
  808. //-- var, const, procedure ---------------------------------------------------
  809. static const Byte kpThisVersion = 0xde;
  810. static const Word DEF_BUFSTREAMSIZE = 0x2000;
  811. extern PACKAGE Dialogs::TOpenDialog* OpenZipDlg;
  812. extern PACKAGE bool __fastcall DelphiIsRunning(void);
  813. extern PACKAGE void __fastcall Register(void);
  814.  
  815. }    /* namespace Vclunzip */
  816. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  817. using namespace Vclunzip;
  818. #endif
  819. #pragma option pop    // -w-
  820. #pragma option pop    // -Vx
  821.  
  822. #pragma delphiheader end.
  823. //-- end unit ----------------------------------------------------------------
  824. #endif    // VCLUnZip
  825.